<!DOCTYPE html>
<html lang="en">
    <head>
        <title>vue.extend 扩展实例构造器</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <script type="text/javascript" src="../assets/js/vue.js"></script>
    </head>
    <body>
        <h1>vue.extend 扩展实例构造器</h1>
        <hr>
        <author></author>
        <div id="author"></div>
        <script type="text/javascript">
           var authorextend=Vue.extend({
               template:'<p><a :href="authorurl">{{authorname}}</a></p>',
               data:function(){
                   return{
                    authorname:'heheda',
                    authorurl:'http://www.baidu.com' 
                   }
               }
           });
           new authorextend().$mount('#author');//在外面绑定到id上
           new authorextend().$mount('author');//在外面绑定到标签上（扩展实例构造器是需要挂载的）
        </script>
    </body>
</html>